package com.qingzhuge.limiter.dto;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author zeroxiao
 * @date 2019/9/4 16:02
 */
@Setter
@Getter
@Builder
public class RateLimiterConfig implements Serializable {
    private static final long serialVersionUID = 4738175716696137638L;
    /**
     * 业务key
     */
    private String key;
    /**
     * 业务、模块名称
     */
    @NotBlank
    private String module;
    /**
     * 允许通过的流量数量
     * 0 = 不限制
     */
    private Long limit;
    /**
     * 限制时间，单位秒钟
     */
    private Long expire;
}
